package com.example.md.mddemo.pingyin_search;

import com.znxz.util.PinyinUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Copyright © 2019年 mddemo. All rights reserved.
 *
 * @author 临江仙 hzqiuxm@163.com
 * 拼音首字母搜索
 * @date 2019/4/10 8:56
 * <p>
 * Modification History:
 * Date     Author    Version      Description
 * ---------------------------------------------------------*
 * 2019/4/10   hzqiuxm   v1.0.0       add
 */
public class PinyinSearch {

    public static void main(String[] args) {

        List<String> names = new ArrayList<>();
        names.add("临江仙Simon");
        names.add("三台");
        names.add("好事近");
        names.add("菩萨蛮");
        names.add("湖之鱼Dvid");


        List<String> pinyinLetters = names.stream()
                .map((name) -> PinyinUtil.getAllFirstLetter(name))
                .collect(Collectors.toList());

        System.out.println(pinyinLetters);
    }

}
